package com.cloudcross.ssp.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloudcross.ssp.base.dao.GenericIBatisDao;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.UserLogin;
import com.cloudcross.ssp.service.IUserLoginService;
import com.cloudcross.ssp.pulgin.mybatis.plugin.PageView;

@Service
public class UserLoginService implements IUserLoginService {
    @Autowired
    private GenericIBatisDao myBatisDao;

    @Override
    public PageView query(PageView pageView, UserLogin t) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("paging", pageView);
        map.put("t", t);
        List<UserLogin> list = myBatisDao.getList("userLoginSqlMapper.query", map);
        pageView.setRecords(list);
        return pageView;
    }

    @Override
    public List<UserLogin> queryAll(UserLogin t) {
        return myBatisDao.getList("userLoginSqlMapper.queryAll", t);
    }

    @Override
    public void delete(String id) throws Exception {
        myBatisDao.save("userLoginSqlMapper.delete", id);

    }

    @Override
    public void update(UserLogin t) throws Exception {
        myBatisDao.save("userLoginSqlMapper.update", t);

    }

    @Override
    public UserLogin getById(String id) {
        // TODO Auto-generated method stub
        return myBatisDao.get("userLoginSqlMapper.getById", id);
    }

    @Override
    public void add(UserLogin t) throws Exception {
        myBatisDao.save("userLoginSqlMapper.add", t);
    }

    @Override
    public int countByParams(Map<String, Object> paramMap) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public List<UserLogin> findByParams(Map<String, Object> paramMap,
                                        Pager pager) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public UserLogin queryUserLoginById(Long id) {
        return myBatisDao.get("userLoginSqlMapper.queryUserLoginById", id);
    }
}
